use futures_core::future::LocalBoxFuture;

use crate::Service;

pub(crate) type BoxedServerService = Box<
    dyn Service<
        // (WorkerCounterGuard, MioStream),
        String,
        Response = (),
        Error = (),
        Future = (),
    >,
>;

// send 表示该类型可以在线程间传输
pub(crate) trait InternalServiceFactory: Send {
    fn name(&self, token: usize) -> &str;
    fn clone_factory(&self) -> Box<dyn InternalServiceFactory>;
    fn create(&self) -> LocalBoxFuture<'static, Result<(usize, BoxedServerService), ()>>;
}
